package com.sptpc.demo.model;

import java.io.Serializable;
import java.time.LocalDate;

public class Student implements Serializable {
    private Long id;

    private String name;

    private LocalDate adminssionDate;

    private String major;

    private static final long serialVersionUID = 1L;

    public Long getId() {
        return id;
    }

    public Student withId(Long id) {
        this.setId(id);
        return this;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public Student withName(String name) {
        this.setName(name);
        return this;
    }

    public void setName(String name) {
        this.name = name == null ? null : name.trim();
    }

    public LocalDate getAdminssionDate() {
        return adminssionDate;
    }

    public Student withAdminssionDate(LocalDate adminssionDate) {
        this.setAdminssionDate(adminssionDate);
        return this;
    }

    public void setAdminssionDate(LocalDate adminssionDate) {
        this.adminssionDate = adminssionDate;
    }

    public String getMajor() {
        return major;
    }

    public Student withMajor(String major) {
        this.setMajor(major);
        return this;
    }

    public void setMajor(String major) {
        this.major = major == null ? null : major.trim();
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", name=").append(name);
        sb.append(", adminssionDate=").append(adminssionDate);
        sb.append(", major=").append(major);
        sb.append("]");
        return sb.toString();
    }
}